<template>
	<view class="paper-item">
		<view class="box">
			<view class="name">
				<view v-if="item.status === 1" class="badge badge--green"><text>续</text></view>
				<text class="content">{{ item.papername }}</text>
				<view v-if="item.status !== 2 || (answer && !score)">
					<my-icon name="chakantimu" style="color: #FFB62B;"></my-icon>
				</view>
				<!-- <image @click.stop="$emit('start-exam', item)" 	v-if="item.status !== 2 || (answer && !score)" style="width: 34upx;height: 38upx;":src="require('../static/icon/exam.png')"></image> -->
				<text v-else :class="['score', item.score >= 60 && 'pass']">{{ item.score || 0 }}分</text>
			</view>
			<view class="info" v-if="!$scopedSlots.info">
				<my-icon name="time"></my-icon>
				<text>创建时间：{{ item.createtime }}</text>
			</view>
			<!-- 自定义底部信息 -->
			<view class="info"><slot name="info" v-bind="item"></slot></view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		item: {
			type: Object,
			required: true
		},
		answer: {
			//针对我的错题，我的收藏使用该组件时，显示答题
			type: Boolean,
			default: false
		},
		score: {
			type: Boolean,
			default: false
		}
	}
};
</script>
<style scoped lang="scss">
	.icon-chakantimu{
		font-size: 40upx;
	}
	.list{
		.paper-item {
			padding: 0 35upx;
			margin: 0;
			flex-direction: column;
			border: none;
			.box{
				padding: 35upx 0;
				border-bottom: 1px solid #EBEBEB;
			}
			.name{
				margin-bottom:18upx!important;
				display: flex;
				justify-content: space-between;
			}
			.info{
				display: flex;
				justify-content: start;
				align-items: center;
				text{
					font-size: 28upx;
					font-weight: 400;
					color: #a6a6a6;
					padding-left: 16upx;
				}
			}
		}
	}
	.icon-time{
		color: #A6A6A6;
		font-size: 28upx;
	}
</style>
